<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" th:with="title='保存打卡',active='publishDing'">
<header th:replace="admin/header::headerFragment(${title},${active})"></header>
<link th:href="@{/admin/plugins/tagsinput/jquery.tagsinput.css}" rel="stylesheet"/>
<link th:href="@{/admin/plugins/select2.dist.css/select2-bootstrap.css}" rel="stylesheet"/>
<link th:href="@{/admin/plugins/toggles/toggles.css}" rel="stylesheet"/>

<link href="//cdn.bootcss.com/multi-select/0.9.12/css/multi-select.css" rel="stylesheet"/>
<link href="//cdn.bootcss.com/select2/3.4.8/select2.min.css" rel="stylesheet"/>
<link th:href="@{/admin/plugins/md/css/style.css}" rel="stylesheet"/>
<style>
    #tags_tagsinput {
        background-color: #fafafa;
        border: 1px solid #eeeeee;
    }

    #tags_addTag input {
        width: 100%;
    }

    #tags_addTag {
        margin-top: -5px;
    }
</style>
<body class="fixed-left">
<div id="wrapper">
    <div th:replace="admin/header::header-body"></div>
    <div class="content-page">
        <div class="content">
            <div class="container">
                <div class="row">
                    <div class="col-sm-12">
                        <h4 class="page-title">
                            <th:block th:if="${null != dings}">
                                编辑打卡
                            </th:block>
                            <th:block th:unless="${null != dings}">
                                发布打卡
                            </th:block>
                        </h4>
                    </div>
                    <div class="col-md-12">
                        <form id="dingForm" role="form" novalidate="novalidate">
                            <input type="hidden" name="did"
                                   th:value="${dings!=null and dings.did!=null}?${dings.did}: ''" id="did"/>
                            <input type="hidden" name="allowStar"
                                   th:value="${dings!=null and dings.allowStar !=null}?${dings.allowStar}: true"
                                   id="allowStar"/>
                            <input type="hidden" name="content" id="content-editor"/>

                            <div class="clearfix"></div>
                            <div class="form-group">
                                <textarea style="height: 450px" autocomplete="off" id="text" name="text"
                                          class="markdown-textarea"
                                          th:utext="${dings!=null and dings.content !=null}?${dings.content}: ''"></textarea>
                            </div>


                            <div class="form-group col-md-3 col-sm-4">
                                <label class="col-sm-4">允许点赞</label>
                                <div class="col-sm-8">
                                    <div th:class="${dings!=null and dings.allowStar !=null}?'toggle toggle-success allow-'+${dings.allowStar}: 'toggle toggle-success allow-true'"
                                         onclick="allow_Star(this);"></div>
                                </div>
                            </div>

                            <div class="clearfix"></div>

                            <div class="text-right">
                                <a class="btn btn-default waves-effect waves-light" th:href="@{/admin/ding}">返回列表</a>

                                <button type="button" class="btn btn-primary waves-effect waves-light"
                                        onclick="subDing();">
                                    发布打卡
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
                <div th:replace="admin/footer :: footer-content"></div>
            </div>
        </div>
    </div>
</div>
<div th:replace="admin/footer :: footer"></div>

<script th:src="@{/admin/plugins/tagsinput/jquery.tagsinput.min.js}"></script>
<script th:src="@{/admin/plugins/jquery-multi-select/jquery.quicksearch.js}"></script>

<script th:src="@{/admin/plugins/md/js/jquery.scrollto.js}"></script>
<script th:src="@{/admin/plugins/md/js/pagedown.js}"></script>
<script th:src="@{/admin/plugins/md/js/pagedown-extra.js}"></script>
<script th:src="@{/admin/plugins/md/js/diff.js}"></script>
<script th:src="@{/admin/plugins/md/js/md.js}"></script>

<script th:src="@{//cdn.bootcss.com/multi-select/0.9.12/js/jquery.multi-select.min.js}"></script>
<script th:src="@{//cdn.bootcss.com/select2/3.4.8/select2.min.js}"></script>
<script th:src="@{//cdn.bootcss.com/jquery-toggles/2.0.4/toggles.min.js}"></script>
<script th:src="@{/admin/js/article.js}"></script>
</body>
</html>